using System;
using System.Collections.Generic;
using System.Text;
using XinBang.Entity;
using XinBang.DAL;

namespace XinBang.BLL
{
    public class GoodsBL
    {
        private IGoodsDA<Goods> gd = BusinessLogicFactory.GetGoodsDA();

        public Goods GetGoodsById(int p)
        {
            return gd.Get(p);
        }

        public IList<Goods> GetAllGoodsByCatid(int catid)
        {
            return gd.GetAllGoodsByCatid(catid);
        }

        public IList<Goods> GetTop10ByHit()
        {
            return gd.GetTopNByHit(10);
        }

        public void UpdateGoods(Goods goods)
        {
            gd.Update(goods);
        }

        public void InsertGoods(Goods goods)
        {
            gd.Insert(goods);
        }

        public void DeleteGoods(Goods goods)
        {
            gd.Delete(goods);
        }
    }
}
